package com.changgou.order.feign;

import com.changgou.entity.Result;
import com.changgou.order.pojo.OrderItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(name = "order")
public interface OrderItemFeign {

    /***
     * 分页搜索实现
     * @param page
     * @param size
     * @return
     */
    @GetMapping(value = "/orderItem/search/{page}/{size}" )
    public Result findPage(@PathVariable("page")  int page, @PathVariable("size")  int size);

    //根据订单id查询订单列表详情
    @GetMapping(value = "/orderItem/findByOrderId/{orderId}")
    public Result<List<OrderItem>> findByOrderId(@PathVariable("orderId") String orderId);

    @DeleteMapping(value = "/orderItem/{id}" )
    public Result delete(@PathVariable("id") String id);
}
